<?php
// 这是系统自动生成的公共文件


if (!function_exists('parent_struct')){
    function parent_struct($data,$pid=0){
        $child = [];
        foreach ($data as $key=>$value){
            if ($value['pid'] == $pid){
                //通过递归方法
                $child[$key] = $value;
                $child[$key]['children'] = parent_struct($data,$value['id']);
            }
        }
        return $child;
    }
}

if (!function_exists('password')){
    function password($password){
        $info = '2006a';
        return md5($info.$password.$info);
    }
}
